/* 
 * File:   TimeUtil.h
 * Author: batista
 *
 * Created on 8 de Mar�o de 2013, 20:41
 */

#ifndef TIMEUTIL_H
#define	TIMEUTIL_H
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <sys/time.h>
#include <iostream>
#include <sstream>
#include <unistd.h>

//#include "printmessage.h"

using namespace std;
using std::string;

class TimeUtil {
public:
    TimeUtil();
    virtual ~TimeUtil();
public:
    string getTime();
    string getTimeRfc2822();
    string getTimeFormat(string format);
    long getDifBetweenTwoTime(string time1, string time2);
    long getTimeInSeg();
    void SetDateStr(string str_date);
    bool ValidAttendTime(string date_info, int time_out);
    void SleepSeg(long time_milissec);
    string SumTimeOut(string data_hora, long timeout);
    string AddZeroLeft(string str);
    string ConvLongToString(long number);
    string ConvIntToString(int num);
    string ConvCharHexToString(char *strchar);
    string CleanRightSpace(string str);
    string ChangeStrHexString(string strstring);
    string StringHexToStringInteger(string str_code_hexa);
    ulong StrToUlong(string str_hex);
    //
    string convCharToLong(char c);
    //
    bool containsChar(const char *array, char c);
    //
    int countChar(const char *array);
    //
    char * addStrCharToMessage(char c);
    //
    char * addStrCharToMessage(const char *array);
    //   
    char * addStrCharToMessage(const char *array, char c);
    //
    char * addStrCharToMessage(const char *array, const char *c);

    //

    string getDay() const {
        return day;
    }

    void setDay(string day) {
        this->day = day;
    }

    string getMin() const {
        return min;
    }

    void setMin(string min) {
        this->min = min;
    }

    string getMth() const {
        return mth;
    }

    void setMth(string mth) {
        this->mth = mth;
    }

    string getMytime() const {
        return mytime;
    }

    void setMytime(string mytime) {
        this->mytime = mytime;
    }

    string getSeg() const {
        return seg;
    }

    void setSeg(string seg) {
        this->seg = seg;
    }

    string getYear() const {
        return year;
    }

    void setYear(string year) {
        this->year = year;
    }

private:
    string day;
    string mth;
    string year;
    string mytime;
    string min;
    string seg;

};

#endif	/* TIMEUTIL_H */

